export default {
    shopMoney(s) {
        let money = 0
        for (let f in s.data) {
            for (let i in s.data[f].data) {
                let d = s.data[f].data[i]
                let m = Number(d.price)
                if (d.checked) {
                    money = money + d.much * m
                }
            }
        }
        return money
    },
    shopMuch(s) {
        let much = 0
        for (let f in s.data) {
            for (let i in s.data[f].data) {
                let d = s.data[f].data[i]
                if (d.checked) {
                    much = much + 1
                }
            }
        }
        return much
    },
    checkedShop(s) {
        let shop = []
        for (let f in s.data) {
            for (let i in s.data[f].data) {
                let d = s.data[f].data[i]
                if (d.checked) {
                    shop.push({
                        goodsId: d.id,
                        count: d.much
                    })
                }
            }
        }
        return shop
    }
}